package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanfeng.business.dto.ManageShopAddressAddDTO;
import com.yuanfeng.business.entity.ShopShippingAddressEntity;
import com.yuanfeng.commoms.vo.shop.ManageShopAddressQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName ShopShippingAddressMapper
 * @Description 商家发货地址
 * @Author cf
 * @Date 2023/7/4 15:04
 * @Version 1.0
 */
@Mapper
public interface ShopShippingAddressMapper extends BaseMapper<ShopShippingAddressEntity> {


    /**
     * 修改店铺默认发货地址的状态
     * @param shopId
     */
    void updateAddressDefault2(@Param("shopId")Integer shopId);

    /**
     * 修改地址
     * @param param
     */
    void updateAddress(@Param("param") ManageShopAddressAddDTO param);

    /**
     * 插入地址
     * @param param
     */
    void insertAddress(@Param("param")ManageShopAddressAddDTO param);

    /**
     * 删除店铺地址
     * @param shippingAddressId
     * @return
     */
    int deleteByPrimaryKey(Integer shippingAddressId);

    /**
     * 店铺发货地址详情查询
     * @param shippingAddressId
     * @return
     */
    ManageShopAddressQueryVO selectShopAddressDetail(@Param("shippingAddressId")Integer shippingAddressId);

    /**
     * 当前地址设置成默认地址
     * @param shippingAddressId
     * @param shopId
     */
    void updateAddressDefault(@Param("shippingAddressId")Integer shippingAddressId, @Param("shopId")Integer shopId);

    /**
     * 把当前地址设置为非默认地址
     * @param shippingAddressId
     * @param shopId
     */
    void updateAddressNoDefault(@Param("shippingAddressId")Integer shippingAddressId, @Param("shopId")Integer shopId);

    /**
     * 查询店铺地址集合
     * @param shopId
     * @return
     */
    List<ManageShopAddressQueryVO> selectShopAddressList(@Param("shopId")Integer shopId);

}
